﻿import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12

Window {
    width: 640
    height: 480
    visible: true
    title: qsTr("Hello World")

    ColumnLayout {
        Switch {
            id:wifi
            text: qsTr("Wi-Fi")
            checked: ctx.wifi
        }
        Switch {
            id:bluetooth
            text: qsTr("Bluetooth")
            checked: ctx.bluetooth
        }
        Binding {
            target: ctx
            property:"wifi"
            value:wifi.checked
        }
        Binding {
            target: ctx
            property:"bluetooth"
            value:bluetooth.checked
        }
        Switch {
            id:wifi1
            text: qsTr("Wi-Fi")
            checked: ctx.submenu.wifi
        }
        Binding {
            target: ctx.submenu
            property:"wifi"
            value:wifi1.checked
        }
        TextField {
            id:path
            text: ctx.submenu.path
        }
        Binding {
            target: ctx.submenu
            property:"path"
            value:path.text
        }
        Button {
            id:btn
            checkable: true
            checked: ctx.submenu.btnCheck
        }
        Binding {
            target: ctx.submenu
            property:"btnCheck"
            value:btn.checked
        }

        ComboBox {
            id:com
            model: ["First", "Second", "Third"]
            currentIndex: ctx.submenu.comboboxIndex
        }
        Binding {
            target: ctx.submenu
            property:"comboboxIndex"
            value:com.currentIndex
        }
    }
}
